import { SheetManager } from "../../ccc3-framework-core/framework/modules/sheetManager";
import { LeveLCfgBase } from "./Sheets"
export class LeveLCfg extends LeveLCfgBase {
  //id索引
  public static get(id: any) {
    if ((this as any)[id]) return (this as any)[id];
    return SheetManager.get("LeveLCfg", id, LeveLCfg);
  }
  public static getAll(): LeveLCfg[] {
    return SheetManager.getAllSheets("LeveLCfg", LeveLCfg);
  }
  public static getCfgByLevel(level: number): LeveLCfg {
    var all = this.getAll();
    var find = all.filter(item => item.ID == level);
    if (find.length > 0) {
      return find[0];
    }
    return null;
  }
}